<template>
  <div
    class="origin_item"
    :ref="dragNode"
    role="Box"
    data-testid="box"
    :class="{ boxShow: !props.isShow }"
  >
    <div class="item_text" :class="'text' + order" v-if="props.isShow">
      {{ props.label }}
    </div>
    <img :src="props.url" :class="'item' + order" v-if="props.isShow" />
  </div>
</template>
<script setup>
import { useDrag } from "vue3-dnd";
const props = defineProps({
  label: String,
  url: String,
  type: String,
  order: Number,
  isShow: Boolean,
});
const [collect, dragNode] = useDrag(() => {
  const { type } = props || {};
  return {
    type,
    item: props,
  };
});
</script>
<style lang="less" scoped>
.origin_item {
  position: relative;
  width: 145px;
  height: 145px;
  border-radius: 28.76px;
  background: #ffffff;
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  .item_text {
    position: absolute;
    left: -7px;
    top: -30px;
    width: 158px;
    height: 55px;
    line-height: 55px;
    border-radius: 40px;
    opacity: 1;
    background: #ffffff;
    box-sizing: border-box;
    border: 2px solid #a48989;
    font-family: FZLanTingYuanS-R-GB;
    font-size: 34px;
    font-weight: normal;
    line-height: 160%;
    text-align: center;
    letter-spacing: 0.09em;
    font-variation-settings: "opsz" auto;
  }
  .text2 {
    left: -25px;
    width: 188px;
  }
  .item0 {
    width: 97px;
    height: 75px;
  }
  .item1 {
    width: 44px;
    height: 107px;
    margin-top: 20px;
  }
  .item2 {
    width: 57px;
    height: 92px;
    margin-top: 20px;
  }
  .item3 {
    width: 91px;
    height: 96px;
    margin-top: 20px;
  }
}
.boxShow {
  background-color: rgba(0, 0, 0, 0);
}
</style>
